/** When your routing table is too long, you can split it into small modules**/

import Layout from '@/layout'

const rbacRouter = {
  path: '/rbac',
  component: Layout,
  redirect: 'noRedirect',
  name: 'RBAC',
  meta: {
    title: 'RBAC',
    icon: 'auth',
    roles: ['admin']
  },
  hidden: true,
  children: [
    {
      path: '/rbac/assignment',
      component: () => import('@/views/rbac/index'),
      redirect: '/rbac/assignment/index',
      name: 'Assignment',
      meta: {
        title: '授权',
        icon: 'em-icon-backlog-round',
        noCache: true
      },
      children: [
        {
          path: '/rbac/assignment/index',
          component: () => import('@/views/rbac/assignment/index'),
          name: 'AssignmentIndex',
          meta: {
            title: '列表',
            noCache: true
          },
          hidden: true
        },
        {
          path: '/rbac/assignment/view/:id(\\d+)',
          component: () => import('@/views/rbac/assignment/view'),
          name: 'rbac/assignment/view/:id',
          meta: {
            title: '授权项',
            noCache: true,
            activeMenu: '/rbac/assignment/index'
          },
          hidden: true
        }
      ]
    },
    {
      path: '/rbac/assignments/:id(\\d+)',
      component: () => import('@/views/rbac/assignment/view'),
      name: 'rbac/assignments/:id',
      meta: {
        title: 'Edit Article',
        noCache: true,
        activeMenu: '/rbac/assignment'
      },
      hidden: true
    },
    {
      path: '/rbac/role',
      component: () => import('@/views/rbac/role'),
      name: 'Role',
      meta: {
        title: '角色',
        icon: 'em-icon-role-hex',
        noCache: true
      }
    },
    {
      path: '/rbac/permission',
      component: () => import('@/views/rbac/permission'),
      name: 'permission',
      meta: {
        title: '权限',
        icon: 'em-icon-backlog-round',
        noCache: true
      }
    },
    {
      path: '/rbac/router',
      component: () => import('@/views/rbac/router'),
      name: 'router',
      meta: {
        title: '路由',
        icon: 'em-icon-rule-c',
        noCache: true
      }
    },
    {
      path: '/rbac/menu',
      component: () => import('@/views/rbac/menu'),
      name: 'Menu',
      meta: {
        title: '菜单',
        icon: 'em-icon-ol-ring',
        noCache: true
      }
    }
  ]
}

export default rbacRouter
